{template common/contentheader} 
<div class="setcontent">
	<div class="settitle">
		<h3>{lang basic_emailsetting:admin}</h3>{template global/basicemailnav}
	</div>
	{template common/info}
	<div class="setform">
		<form class="pzform" method="post" action="{url admin/basicemail?act=save}" id="addform">
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_protocol:admin}:</label>
				<div class="formcontrol">
              		<select name="protocol" id="protocol">
						<option value="mail" {if $setting['protocol']=='mail'}selected{/if}>mail</option> 
						<option value="sendmail" {if $setting['protocol']=='sendmail'}selected{/if}>sendmail</option> 
						<option value="smtp" {if $setting['protocol']=='smtp'}selected{/if}>smtp</option> 
					</select>
				</div>
				<span class="formhelp">{lang basic_emailsetting_protocol_tip:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_from:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="from" value="$setting['from']"/>
				</div>
				<span class="formhelp">{lang basic_emailsetting_from:admin}</span>
			</div>
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_sender:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="sender" value="$setting['sender']"/>
				</div>
				<span class="formhelp">{lang basic_emailsetting_sender:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_smtphost:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="smtp_host" class="dis" value="$setting['smtp_host']" {if $setting['protocol']!='smtp'}disabled{/if}/>
				</div>
				<span class="formhelp">{lang basic_emailsetting_smtphost:admin}</span>
			</div>
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_smtpuser:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="smtp_user" class="dis" value="$setting['smtp_user']" {if $setting['protocol']!='smtp'}disabled{/if}/>
				</div>
				<span class="formhelp">{lang basic_emailsetting_smtpuser:admin}</span>
			</div>
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_smtppass:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="smtp_pass" class="dis" value="$setting['smtp_pass']" {if $setting['protocol']!='smtp'}disabled{/if}/>
				</div>
				<span class="formhelp">{lang basic_emailsetting_smtppass:admin}</span>
			</div>
			<div class="formgroup">
				<label class="formlabel">{lang basic_emailsetting_smptport:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="smtp_port" class="dis" value="$setting['smtp_port']" {if $setting['protocol']!='smtp'}disabled{/if}/>
				</div>
				<span class="formhelp">{lang basic_emailsetting_smptport:admin}</span>
			</div>
			<div class="formbuttons">
				<button type="submit" class="btn btn-primary">{lang save:admin}</button>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
	$('#protocol').change(function (){
		if($(this).val()=='smtp'){
			$(".dis").removeAttr('disabled');
		}else{
			$(".dis").attr('disabled','disabled');
		}
	});
});
</script>
{template common/contentfooter}